package com.example.project.dao;

import com.example.project.dao.sqls.UserProvider;
import com.example.project.entity.User;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

@Mapper
public interface UserDao {
    @SelectProvider(type = UserProvider.class, method = "findAllSql")
    List<User> findAll();
    @SelectProvider(type = UserProvider.class, method = "findByIdSql")
    User findById(Long id);
    @SelectProvider(type = UserProvider.class, method = "findByNameSql")
    User findByName(String username);
    @InsertProvider(type = UserProvider.class, method = "saveUserSql")
    void saveUser(User user);
}
